from django.db import models
from gis.common.django_ext.models import BaseModel, ListField
from itpay.core.mch.const import MchType


class Account(BaseModel):
    """
    商户账号
    """
    name = models.CharField(max_length=64, unique=True)  # 商户名称

    enable = models.BooleanField(default=True)
    api_key = models.CharField(max_length=128)  # 商户秘钥

    mch_type = models.IntegerField(default=MchType.INNER.value)

    create_order_url = models.CharField(max_length=512, null=True)  # 创建订单url
    recharge_order_url = models.CharField(max_length=512, null=True)  # 充值url
    chase_order_url = models.CharField(max_length=512, null=True)  # 追分url
    fail_order_url = models.CharField(max_length=512, null=True)  # 订单失败url
    get_charge_info_url = models.CharField(max_length=512, null=True)  # 查询累计充值数据url
